package com.zj.osm.entity.greendao;

import com.zj.osm.entity.db.DaoSession;
import com.zj.osm.entity.db.PowerSupplySchemeDao;
import com.zj.osm.entity.db.PowerSupplySchemeDetailsDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;

/**
 * @author jiang zhu on 2019/10/30
 */
@Entity
public class PowerSupplyScheme {

    @Id
    private Long id;
    //申请编号
    private String applyCode;
    //用户编号
    private String userCode;
    //用户名称
    private String userName;
    //项目名称
    private String projectName;
    //用电地址
    private String electricityAddress;
    //申请类型
    private String applyType;
    //联系地址i
    private String address;
    //经办人
    private String operator;
    //固定电话
    private String operatorFixedPhone;
    //移动电话
    private String operatorPortableTelephone;
    //负责人
    private String pic;
    //负责人固定电话
    private String picFixedPhone;
    //负责人移动电话
    private String picPortableTelephone;
    //供电方案
    private String schemeExplain;
    //审批意见
    private String opinion;
    //审批时间
    private String opinionTime;
    //图片路径
    private String diagram;
    //工程编号
    private String projectCode;
    //项目id
    private Long projectId;
    @ToMany(referencedJoinProperty = "powerSupplySchemeId")
    private List<PowerSupplySchemeDetails> powerSupplySchemeDetailsList;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 298191333)
    private transient PowerSupplySchemeDao myDao;
    @Generated(hash = 507628101)
    public PowerSupplyScheme(Long id, String applyCode, String userCode, String userName,
            String projectName, String electricityAddress, String applyType, String address,
            String operator, String operatorFixedPhone, String operatorPortableTelephone, String pic,
            String picFixedPhone, String picPortableTelephone, String schemeExplain, String opinion,
            String opinionTime, String diagram, String projectCode, Long projectId) {
        this.id = id;
        this.applyCode = applyCode;
        this.userCode = userCode;
        this.userName = userName;
        this.projectName = projectName;
        this.electricityAddress = electricityAddress;
        this.applyType = applyType;
        this.address = address;
        this.operator = operator;
        this.operatorFixedPhone = operatorFixedPhone;
        this.operatorPortableTelephone = operatorPortableTelephone;
        this.pic = pic;
        this.picFixedPhone = picFixedPhone;
        this.picPortableTelephone = picPortableTelephone;
        this.schemeExplain = schemeExplain;
        this.opinion = opinion;
        this.opinionTime = opinionTime;
        this.diagram = diagram;
        this.projectCode = projectCode;
        this.projectId = projectId;
    }
    @Generated(hash = 225677818)
    public PowerSupplyScheme() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getApplyCode() {
        return this.applyCode;
    }
    public void setApplyCode(String applyCode) {
        this.applyCode = applyCode;
    }
    public String getUserCode() {
        return this.userCode;
    }
    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }
    public String getUserName() {
        return this.userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getProjectName() {
        return this.projectName;
    }
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }
    public String getElectricityAddress() {
        return this.electricityAddress;
    }
    public void setElectricityAddress(String electricityAddress) {
        this.electricityAddress = electricityAddress;
    }
    public String getApplyType() {
        return this.applyType;
    }
    public void setApplyType(String applyType) {
        this.applyType = applyType;
    }
    public String getAddress() {
        return this.address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getOperator() {
        return this.operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
    public String getOperatorFixedPhone() {
        return this.operatorFixedPhone;
    }
    public void setOperatorFixedPhone(String operatorFixedPhone) {
        this.operatorFixedPhone = operatorFixedPhone;
    }
    public String getOperatorPortableTelephone() {
        return this.operatorPortableTelephone;
    }
    public void setOperatorPortableTelephone(String operatorPortableTelephone) {
        this.operatorPortableTelephone = operatorPortableTelephone;
    }
    public String getPic() {
        return this.pic;
    }
    public void setPic(String pic) {
        this.pic = pic;
    }
    public String getPicFixedPhone() {
        return this.picFixedPhone;
    }
    public void setPicFixedPhone(String picFixedPhone) {
        this.picFixedPhone = picFixedPhone;
    }
    public String getPicPortableTelephone() {
        return this.picPortableTelephone;
    }
    public void setPicPortableTelephone(String picPortableTelephone) {
        this.picPortableTelephone = picPortableTelephone;
    }
    public String getSchemeExplain() {
        return this.schemeExplain;
    }
    public void setSchemeExplain(String schemeExplain) {
        this.schemeExplain = schemeExplain;
    }
    public String getOpinion() {
        return this.opinion;
    }
    public void setOpinion(String opinion) {
        this.opinion = opinion;
    }
    public String getOpinionTime() {
        return this.opinionTime;
    }
    public void setOpinionTime(String opinionTime) {
        this.opinionTime = opinionTime;
    }
    public String getDiagram() {
        return this.diagram;
    }
    public void setDiagram(String diagram) {
        this.diagram = diagram;
    }
    public String getProjectCode() {
        return this.projectCode;
    }
    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }
    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 2128824905)
    public List<PowerSupplySchemeDetails> getPowerSupplySchemeDetailsList() {
        if (powerSupplySchemeDetailsList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PowerSupplySchemeDetailsDao targetDao = daoSession
                    .getPowerSupplySchemeDetailsDao();
            List<PowerSupplySchemeDetails> powerSupplySchemeDetailsListNew = targetDao
                    ._queryPowerSupplyScheme_PowerSupplySchemeDetailsList(id);
            synchronized (this) {
                if (powerSupplySchemeDetailsList == null) {
                    powerSupplySchemeDetailsList = powerSupplySchemeDetailsListNew;
                }
            }
        }
        return powerSupplySchemeDetailsList;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 1146523199)
    public synchronized void resetPowerSupplySchemeDetailsList() {
        powerSupplySchemeDetailsList = null;
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 666568872)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getPowerSupplySchemeDao() : null;
    }
    public Long getProjectId() {
        return this.projectId;
    }
    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

}
